<%@ Page Language="C#" MasterPageFile="../Master/MasterPageAdm.master" AutoEventWireup="true"
    CodeFile="CadT_AUTOR.aspx.cs" Inherits="Cadastro_CadT_AUTOR" Title="UMEVOR - Autores" %>

<asp:Content ID="cphPagina" ContentPlaceHolderID="cphPagina" runat="Server">

    <script language="javascript" type="text/javascript">
    
    function limparCampos()
    {
        
    }
    
    function validarSalvar()
    {
        return true;
    }
    
    function validarExcluir()
    {
        return true;
    }
    
    function EditarAutor(codigo,autor,tipo)
    {
        var txtAutor = document.getElementById('ctl00_cphPagina_txtAutor');
        var cmbTipo = document.getElementById('ctl00_cphPagina_cmbTipo');
        var hidden = document.getElementById('ctl00_cphPagina_autorHiddenField');
        
        txtAutor.value = autor;
        cmbTipo.value = tipo;
        hidden.value = codigo;   
        
        txtAutor.focus(); 
    }
    </script>

    <table cellspacing="0" cellpadding="0" width="100%" border="0" align="left">
        <tr>
            <td colspan="2" class="titulo_miolo" style="padding-left: 8px; height: 20px; background-image: url(../images/bara_sobrecsn.jpg);
                width: 100%;" align="left">
                <b>Autores</b></td>
        </tr>
        <tr>
            <td colspan="2" style="height: 25px; width: 100%;" align="left">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td style="height: 51px; padding-left: 30px; width: 758px;" align="left">
            <table style="height: 8px; text-align: left;" border="0" class="texto">
                <tr>
                    <td align="left" style="height: 19px; width: 348px;">
                        <b>*Autor</b></td>
                    <td align="left" style="width: 222px; height: 19px">
                        <b>
                        *Tipo</b></td>
                </tr>
                <tr>
                    <td style="width: 348px; height: 19px;" align="left">
                        <asp:TextBox ID="txtAutor" runat="server" CssClass="texto" onblur="mascara(this,caracteresValidos)"
                            Width="330px" TabIndex="1" MaxLength="60"></asp:TextBox>
                        <asp:HiddenField ID="autorHiddenField" runat="server" />
                    </td>
                    <td align="left" style="width: 222px; height: 19px">
                    <asp:DropDownList ID="cmbTipo" runat="server" Width="217px" CssClass="combo" TabIndex="2">
                        </asp:DropDownList></td>
                </tr>
                <tr>
                    <td align="right" colspan="2" style="height: 19px">
                        </td>
                </tr>
                <tr>
                    <td align="right" colspan="2" style="height: 19px">
                        <asp:ImageButton ID="btPesquisar" runat="server" ImageUrl="../images/bt_pesquisar.gif" OnClick="btPesquisar_Click" TabIndex="3" />
                        <asp:ImageButton ID="btSalvar" runat="server" ImageUrl="../images/bt_gravar.gif" OnClick="btSalvar_Click" TabIndex="4" />
                        <asp:ImageButton ID="btExcluir" runat="server" ImageUrl="../images/bt_excluir.gif" OnClick="btExcluir_Click" TabIndex="5" />
                        <asp:ImageButton ID="btLimpar" runat="server" ImageUrl="../images/bt_limpar.gif" OnClick="btLimpar_Click" TabIndex="6" />
                    </td>
                </tr>
                <tr>
                    <td align="left" colspan="3" style="height: 19px; width: 571px;">
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td align="left" colspan="3" style="height: 19px; width: 571px;"></td>
                </tr>
                <tr align="center">
                    <td align="left" colspan="3" rowspan="2" style="width: 571px">
                        <asp:GridView id="gvAutor" runat="server" Width="100%" CssClass="texto" DataKeyNames="TX_NOME" AutoGenerateColumns="False" AllowSorting="True" AllowPaging="True" PageSize="20" OnRowCreated="gvAutor_RowCreated" OnPageIndexChanging="gvAutor_PageIndexChanging" TabIndex="7">
                    <PagerSettings Mode="NumericFirstLast"  />
                    <FooterStyle CssClass="texto"  />
                    <Columns>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:CheckBox ID="chkExclusao" runat="server" /></td>   
                            </ItemTemplate> 
                            <ItemStyle Width="20px" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Autor">
                            <ItemStyle Width="250px"  />
                            <HeaderStyle Width="80px"  />
                            <ItemTemplate>
                                <asp:LinkButton ID="nameLinkButton" runat="server" CausesValidation="false" CssClass="link_azul"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="ID_AUTOR" Visible="False" />
                        <asp:TemplateField HeaderText="Tipo">
                            <ItemStyle Width="100px" />
                            <ItemTemplate>
                                <asp:Label ID="lblTipo" runat="server"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <RowStyle CssClass="grvItemStyle"  />
                    <PagerStyle BackColor="#EA944B" ForeColor="White" CssClass="texto" HorizontalAlign="Center"  />
                    <HeaderStyle BackColor="#EA944B" ForeColor="White" CssClass="texto"  />
                    <AlternatingRowStyle CssClass="grvItemStyleAlternate"  />
                </asp:GridView>
                        &nbsp; &nbsp;</td>
                </tr>
            </table>   
            </td>
        </tr>
    </table>
</asp:Content>
